package com.example.demo.service;

import com.example.demo.entity.UserInfo;
import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Description:
 * User: 故我
 * Date: 2023-11-08
 * Time: 11:49
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public Integer register(UserInfo userInfo){
        return userMapper.register(userInfo);
    }

    public UserInfo login(String username){
        return userMapper.getUserByName(username);
    }

    public UserInfo getUserById(Integer id){
        return userMapper.getUserById(id);
    }
}
